<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>飞机大战</title>
    <link rel="stylesheet" href="./css/style.css">
</head>
<body>
    <div class="game-container">
        <div class="game-header">
            <div class="score-panel">
                <span>分数: <span id="score">0</span></span>
            </div>
            
            <!-- 血条UI 已移至Canvas绘制，隐藏原DOM元素 -->
            <div class="health-bar-container" style="display: none;">
                <div class="health-bar-label">血量</div>
                <div class="health-bar-wrapper">
                    <div class="health-bar-background">
                        <div id="health-bar-transition" class="health-bar health-bar-transition"></div>
                        <div id="health-bar-current" class="health-bar health-bar-current"></div>
                    </div>
                    <div class="health-bar-text">
                        <span id="health-current">5</span>/<span id="health-max">5</span>
                    </div>
                </div>
            </div>
            
            <button id="pause-btn" class="pause-btn">暂停</button>
        </div>
        
        <div class="game-area">
            <canvas id="gameCanvas"></canvas>
            
            <!-- 游戏开始界面 -->
            <div id="start-screen" class="game-screen">
                <h1>飞机大战</h1>
                <p>使用 WASD 或 方向键 移动飞机</p>
                <p>按 空格键 射击</p>
                <button id="start-btn" class="btn">开始游戏</button>
            </div>
            
            <!-- 游戏暂停界面 -->
            <div id="pause-screen" class="game-screen" style="display: none;">
                <h2>游戏暂停</h2>
                <button id="resume-btn" class="btn">继续游戏</button>
                <button id="restart-btn" class="btn">重新开始</button>
            </div>
            
            <!-- 游戏结束界面 -->
            <div id="game-over-screen" class="game-screen" style="display: none;">
                <h2>游戏结束</h2>
                <p>最终得分: <span id="final-score">0</span></p>
                <button id="restart-game-btn" class="btn">重新开始</button>
            </div>
        </div>
    </div>
    
    <!-- ES6模块引入 -->
    <script type="module" src="./js/game.js"></script>
</body>
</html>